//----------------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------------
Ti.include('include.js');

//----------------------------------------------------------------------------
// Windows & Tabs
//----------------------------------------------------------------------------

//Home
var winHome = Titanium.UI.createWindow({
   title : 'Welkom',
   barColor : '#7bb14d',
   backgroundImage : 'images/backgrounds/bg-default.png',
   url : 'home_iphone.js'
});
var tabHome = Titanium.UI.createTab({
   icon : 'images/icons/home32.png',
   title : 'Home',
   window : winHome
});

//Herhaal recepten
var winRecepten = Titanium.UI.createWindow({
   title : 'Herhaalrecepten',
   barColor : '#7bb14d',
   backgroundImage : 'images/backgrounds/bg-default.png',
   url : 'hhrecept_iphone.js'
});
var tabRecepten = Titanium.UI.createTab({
   icon : 'images/icons/notepencil32.png',
   title : 'Recepten',
   window : winRecepten
});

// Medewerkers
var winMdw = Titanium.UI.createWindow({
   title : 'Medewerkers',
   barColor : '#7bb14d',
   backgroundImage : 'images/backgrounds/bg-default.png',
   url : 'mdw_iphone.js'
});
var tabMdw = Titanium.UI.createTab({
   icon : 'images/icons/112-group.png',
   title : 'Medewerkers',
   window : winMdw
});

// Kaart
var winMap = Titanium.UI.createWindow({
   title : 'Kaart',
   barColor : '#7bb14d',
   backgroundImage : 'images/backgrounds/bg-default.png',
   url : 'map_iphone.js'
});
var tabMap = Titanium.UI.createTab({
   icon : 'images/icons/103-map.png',
   title : 'Kaart',
   window : winMap
});

// Info
var winInfo = Titanium.UI.createWindow({
   title : 'Info',
   barColor : '#7bb14d',
   backgroundImage : 'images/backgrounds/bg-default.png',
   url : 'info_iphone.js'
});
var tabInfo = Titanium.UI.createTab({
   icon : 'images/icons/questionbook32.png',
   title : 'Info',
   window : winInfo
});


//----------------------------------------------------------------------------
// Tabs
//----------------------------------------------------------------------------
var tabGroup = Titanium.UI.createTabGroup();
tabGroup.addTab(tabHome);
tabGroup.addTab(tabRecepten);
tabGroup.addTab(tabMdw);
tabGroup.addTab(tabMap);
tabGroup.addTab(tabInfo);

//----------------------------------------------------------------------------
// Open tab group
//----------------------------------------------------------------------------
setTimeout(function() {
   tabGroup.open({transition: Titanium.UI.iPhone.AnimationStyle.CURL_UP});
}, 2000);
